package com.zyd.io.vo.vehicle;

import java.io.Serializable;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class VehicleTrackResVO  implements Serializable,Comparable<VehicleTrackResVO> {

    private String stationcode;

    private String jd;

    private String wd;

    private String stationname;

    private String address;

    private String aftertime;


    private String vinno;

    public String getStationcode() {
        return stationcode;
    }

    public void setStationcode(String stationcode) {
        this.stationcode = stationcode;
    }

    public String getJd() {
        return jd;
    }

    public void setJd(String jd) {
        this.jd = jd;
    }

    public String getWd() {
        return wd;
    }

    public void setWd(String wd) {
        this.wd = wd;
    }

    public String getStationname() {
        return stationname;
    }

    public void setStationname(String stationname) {
        this.stationname = stationname;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getAftertime() {
        return aftertime;
    }

    public void setAftertime(String aftertime) {
        this.aftertime = aftertime;
    }

    public String getVinno() {
        return vinno;
    }

    public void setVinno(String vinno) {
        this.vinno = vinno;
    }

    @Override
    public int compareTo(VehicleTrackResVO o) {
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Long l=0L;
        try {
            Date parse = format.parse(this.getAftertime());
            Date parse1 = format.parse(o.getAftertime());
             l = parse.getTime() - parse1.getTime();
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return Math.toIntExact(l);
    }
}
